package com.chinasofti.set;

import java.util.Iterator;
import java.util.TreeSet;

public class Set {
    public static void main(String[] args) {
        java.util.Set<String> stringSet = new TreeSet<>();
        stringSet.add("asd");
        stringSet.add("asd");
        stringSet.add("asd1");
        for (String a : stringSet){
            System.out.println(a);
        }
        Iterator<String>it = stringSet.iterator();
        while (it.hasNext()){
            String s = it.next();
            System.out.println(s);
        }
    }
}
